import React, { Component } from 'react';
import { connect } from 'react-redux'
import { addUser, setName} from '../store/actions'


const mapStateToProps = (state) => {
    console.log('mapStateToProps:', state)
    return {
        user: state.storeUser.user
    }
};

const mapDispatchToProps = {
    onSetName: setName
};

let ShowWidget = ({user}) => (
    <div>
        {/*<div>hello</div>*/}
        <div>{user.name}</div>
    </div>
);

ShowWidget = connect(
    mapStateToProps,
    mapDispatchToProps
)(ShowWidget);

export default ShowWidget